#pragma once
#pragma pack(1)
#pragma pack(pop)

#include<stdio.h>
#include<stdlib.h>
#include<string.h>

#define S 30
#define C 6

typedef struct {
	long long ID;
	char Name[20];
	float Grade[C];
	float General;
	float Average;
}STUDENT;

typedef struct {
	float General;
	float Average;
	char Name[20];
	//定义变量用以承接各阶段学生数
	int good;
	int lh;
	int zd;
	int jg;
	int bad;
	//定义变量用以承接个阶段学生所占百分比
	float good_pt;
	float lh_pt;
	float zd_pt;
	float jg_pt;
	float bad_pt;
}GRADE;

STUDENT stu[S];
GRADE grd[C];

void Run(STUDENT stu[], GRADE grd[]);
void Input_Excel(STUDENT stu[], GRADE grd[], int s, int c);
void Input(STUDENT stu[], GRADE grd[], int s, int c);
void Calculate(STUDENT stu[], GRADE grd[], int s, int c);
int Sort_General_up(const void* p1, const void* p2);
int Sort_General_down(const void* p1, const void* p2);
int Sort_ID_down(const void* p1, const void* p2);
int Sort_Name(const void* p1, const void* p2);
void Search(STUDENT stu[], int s, int c);
void Statistical(STUDENT stu[], GRADE grd[], int s, int c);
void Print(STUDENT stu[], GRADE grd[], int s, int c);
void Print_Excel(STUDENT stu[], GRADE grd[], int s, int c);
